package com.matrix.java.chap_04;

import java.util.Scanner;

/*
    圆上的随机点
    随机三个角度,角度各不相同
 */
public class Ex4_06 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double angle1;
        double angle2;
        double angle3;
        do {
            angle1 = Math.random() * 360;
            angle2 = Math.random() * 360;
            angle3 = Math.random() * 360;
        } while (angle1 == angle2 && angle1 == angle3);
        int r = 40;
        double x1 = r * Math.cos(2 * Math.PI * angle1 / 360);
        double y1 = r * Math.sin(2 * Math.PI * angle1 / 360);
        double x2 = r * Math.cos(2 * Math.PI * angle2 / 360);
        double y2 = r * Math.sin(2 * Math.PI * angle2 / 360);
        double x3 = r * Math.cos(2 * Math.PI * angle3 / 360);
        double y3 = r * Math.sin(2 * Math.PI * angle3 / 360);
        System.out.println(angle1 + " " + angle2 + " " + angle3);
        System.out.printf("%s%.2f%s%.2f%s", "(", x1, ",", y1, ")");
        System.out.printf("%s%.2f%s%.2f%s", "(", x2, ",", y2, ")");
        System.out.printf("%s%.2f%s%.2f%s", "(", x3, ",", y3, ")");

        input.close();
    }
}
